/*
** public.h
**
** This is the header file that goes with the Sybase Client-Library example
** programs.
**
*/

#ifndef		_PUBLIC_H
#define		_PUBLIC_H

/* Sccsid %Z% %M% %I% %G% */

/*
** Define symbolic names, constants, and macros
*/
#define	PUB_MAXSTRINGLEN	255
#define	PUB_BUFSIZE		1024
#define	PUB_CTLIB_VERSION	CS_VERSION_100
#define	PUB_ERROR_OUT		stderr
#define MAX_TABLE_NAME_ENG_LEN	32
#define MAX_TABLE_NAME_CHN_LEN  40
#define MAX_COLUMN_NAME_ENG_LEN 32
#define MAX_COLUMN_NAME_CHN_LEN 40

/** Define the max length of a frame **/
// Modified by ZJH in SZDMS
//#define PUB_MAX_FRAME_LENGTH	19900
#define	PUB_MAX_FRAME_LENGTH	199900


/*
** define exit status values
*/
#ifdef vms
#include <stsdef.h>
#define	PUB_EXIT_SUCCEED	(STS$M_INHIB_MSG|STS$K_SUCCESS)
#define	PUB_EXIT_FAIL		(STS$M_INHIB_MSG|STS$K_ERROR)
#else
#define	PUB_EXIT_SUCCEED	0
#define	PUB_EXIT_FAIL		1
#endif /*vms*/

/*
** define global variables used in all programs
*/
#ifdef	_ALPHA
#else
#endif

/*
** For some platforms (e.g windows 3.1), additional work needs to be done to
** insure that the output of some of the programs can be displayed.
** This macro will insure that any setup is done for the platform.
** For windows, _wsetscreenbuf(_fileno(stdout), _WINBUFINT) will set QuickWin's
** standard output screen buffer to unlimited size.
*/

#if QWIN
#define PUB_SCREEN_INIT() _wsetscreenbuf(_fileno(stdout), _WINBUFINF)
#else /*QWIN*/
#define PUB_SCREEN_INIT()
#endif /*QWIN*/

#define		ORA_CHAR_TYPE		1
#define		ORA_VARCHAR_TYPE	2
#define		ORA_TINYINT_TYPE	3
#define		ORA_SMALLINT_TYPE	4
#define		ORA_INT_TYPE		5
#define		ORA_FLOAT_TYPE		6
#define		ORA_DOUBLE_TYPE		7
#define 	ORA_BIT_TYPE		8
#define		ORA_DATETIME_TYPE	9
#define		ORA_KEYID_TYPE		10
#define		ORA_BINARY_TYPE		11

/**** Define the global C data types constants used in all programs    ****/
/*#define		C_CHAR_TYPE		1
#define		C_UCHAR_TYPE		2
#define		C_SHORT_TYPE		3
#define		C_INT_TYPE		4
#define		C_TIME_TYPE		5
#define		C_FLOAT_TYPE		6
#define		C_DOUBLE_TYPE		7
#define		C_KEYID_TYPE		8
#define		C_BINARY_TYPE		9*/

/*** Define the application number and types ***/
#define		APPLICATION_NUMBER	7

#define		APPLICATION_PUBLIC      255	
#define		APPLICATION_SCADA	1
#define		APPLICATION_PAS		2
#define		APPLICATION_DPAS	4
#define		APPLICATION_FRONT	8
#define		APPLICATION_AGC		16
#define		APPLICATION_EDC		32
#define		APPLICATION_FA		64
#define		APPLICATION_PAS_RES	128
#define		APPLICATION_DPAS_RES	256
#define		APPLICATION_AGC_RES	512
#define		APPLICATION_EDC_RES	1024
#define		APPLICATION_FA_RES	2048

#define		RESEARCH_FLAG		16384

#define		DB_LOGIN_USERNAME	"test"
#define		DB_LOGIN_PASSWD		"test000"

/*** define the application no ***/
#define		APP_SCADA			1
#define		APP_PAS				2
#define		APP_DPAS 			4
#define		APP_FRONT			8
#define		APP_AGC				16
#define		APP_HTED			32
#define		APP_FA				64
#define		APP_PAS_SE			9
#define		APP_PAS_LF			10
#define		APP_PAS_CA			11
#define		APP_PAS_OF			12


/*** define the yc_sample_definition table_name for different application ***/
#define		SAMPLE_DEF_SCADA		"yc_sample_define"
#define		SAMPLE_DEF_PAS			""
#define		SAMPLE_DEF_DPAS			""
#define		SAMPLE_DEF_FRONT		""
#define		SAMPLE_DEF_AGC			""
#define		SAMPLE_DEF_HTED			""
#define		SAMPLE_DEF_FA			""
#define		SAMPLE_DEF_PAS_SE		""
#define		SAMPLE_DEF_PAS_LF		""
#define		SAMPLE_DEF_PAS_CA		""
#define		SAMPLE_DEF_PAS_OF		""

/*** define the dd_sample_definition table_name for different application ***/
#define		DD_SAMPLE_DEF_SCADA		"dd_sample_define"



#endif
